﻿using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Assignment3.Objects3D
{
    class SymmetricObject
    {
        private Vector3 size;
        private Vector3 position;
        private VertexPositionNormalTexture[][] faces;
        private int primitivePerFace;
        private int numberOfFaces;

        //number of vertices of one primitive
        private const int primitiveVertices = 3;

        public Vector3 Size
        {
            get { return this.size; }
            set { this.size = value; }
        }

        public Vector3 Position
        {
            get { return this.position; }
            set { this.position = value; }
        }

        public int PrimitivePerFace
        {
            get { return this.primitivePerFace; }
            set { this.primitivePerFace = value; }
        }

        public int NumberOfFaces
        {
            get { return this.numberOfFaces; }
            set { this.numberOfFaces = value; }
        }

        public VertexPositionNormalTexture[][] Faces
        {
            get { return this.faces; }
            set { this.faces = value; }
        }

        //public VertexPositionNormalTexture[] getFace(int faceNumber)
        //{
        //    return faces[faceNumber];
        //}        

        public SymmetricObject()
        {
            StartUp(new Vector3(0, 0, 0), new Vector3(0, 0, 0), 0, 0);
        }

        public SymmetricObject(Vector3 size, Vector3 position, int numberOfFaces, int primitivePerFace)
        {
            StartUp(size, position, numberOfFaces, primitivePerFace);
        }

        public virtual void StartUp(Vector3 size, Vector3 position, int numberOfFaces, int primitivePerFace)
        {
            this.size = size;
            this.position = position;
            this.numberOfFaces = numberOfFaces;
            this.primitivePerFace = primitivePerFace;
            this.faces = new VertexPositionNormalTexture[this.numberOfFaces][];
            for (int i = 0; i < this.numberOfFaces; i++)
            {
                this.faces[i] = new VertexPositionNormalTexture[this.primitivePerFace * primitiveVertices];
            }
        }

        public virtual void BuildShape()
        {

        }        
    }
}
